<template>
  <view class="purchanse_id">
    <info-unpaid v-if="true" :order-form-info="orderFormInfo"></info-unpaid>
    <info-close v-if="false" :order-form-info="orderFormInfo"></info-close>
    <info-complete v-if="false" :order-form-info="orderFormInfo"></info-complete>
    <info-wait-delivery v-if="false" :order-form-info="orderFormInfo"></info-wait-delivery>
  </view>
</template>

<script>
import infoClose from './@fragment/info-close.vue';
import infoComplete from './@fragment/info-complete.vue';
import infoWaitDelivery from './@fragment/info-wait-delivery.vue';
import { model } from "@/model";
import InfoUnpaid from './@fragment/info-unpaid.vue';

const { OrderForm } = model.collection;

export default {
  components: {
    infoClose,
    infoComplete,
    infoWaitDelivery,
    InfoUnpaid
  },
  data () {
    return {
      orderFormInfo: {}
    }
  },
  onLoad (options) {
    this.getPurchanseInfo(options.id);
  },
  created () { },
  mounted () { },
  methods: {
    getPurchanseInfo (id) {
      OrderForm.sendApi("formInfo", {
        params: {
          id
        },
        data: {},
      }, { parse4Entity: true }).then((res) => {
        const { status, data } = res || {};
        if (status) {
          this.orderFormInfo = data;
        }
      })
    }
  }
}
</script>
<style lang="less" >
page {
  background: #f7f7f7;
  .purchanse_id {
    height: 100%;
  }
}
</style>
